package hcs.ops.test;

import java.util.Scanner;

import org.openqa.selenium.WebDriver;

import hcs.ops.func.*;


public class Retest {

	public static WebDriver driver;
	public static String lName="";
	public static String pin="";
	
	static
	Webdriver d = new Webdriver();
	static
	Login log = new Login();
	static
	Logout out = new Logout();
	static
	Hcs_NewPatient newPatient = new Hcs_NewPatient();
	static
	Hcs_Admission admit = new Hcs_Admission();
	static
	Hcs_Nursing pack = new Hcs_Nursing();
	static
	Web_App app = new Web_App();

	public static void main(String args[]) throws Exception{
		
		Scanner scan = new Scanner(System.in);
		System.out.println(" "
				+ "1 = Full Payment "
				+ "\n 2 = Partial Payment "
				+ "\n 3 = Decimal Payment "
				+ "\n 4 = Visa Payment"
				+ "\n 5 = Mastercard Payment"
				+ "\n 6 = Payment with Guarantor"
				+ "\n 7 = Payment without Guarantor"
				);
		System.out.println("Please select a number that corresponds to the transaction.");
		String option = scan.nextLine();
		scan.close();
		
		if(option.equals("1")){
			full_payment();
		}
		else if(option.equals("2")){
			partial_payment();
		}
		else if(option.equals("3")){
			decimal_payment();
		}
		else if(option.equals("4")){
			visa_payment();
		}
		else if(option.equals("5")){
			mastercard_payment();
		}
		else if(option.equals("6")){
			withguarantor_payment();
		}
		else if(option.equals("7")){
			noguarantor_payment();
		}
		
	}
	
	public static void full_payment() throws Exception
	{
	
		//START OPS WEBAPP
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		String for_checking = app.step2(driver, "full");
		app.click_agreement(driver);
		app.step_payment(driver, "mastercard");
		app.view_or(driver);
		
		//FOR CHECKING
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		app.verifying_payment(driver, for_checking);
		
	}
	public static void partial_payment() throws Exception
	{
		
		//START OPS WEBAPP
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		String for_checking = app.step2(driver, "partial");
		app.click_agreement(driver);
		app.step_payment(driver, "mastercard");
		app.view_or(driver);
		
		//FOR CHECKING
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		app.verifying_payment(driver, for_checking);
	}
	public static void decimal_payment() throws Exception
	{

		
		//START OPS WEBAPP
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		String for_checking = app.step2(driver, "decimal");
		app.click_agreement(driver);
		app.step_payment(driver, "mastercard");
		app.view_or(driver);
		
		//FOR CHECKING
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		app.verifying_payment(driver, for_checking);
	}
	public static void visa_payment() throws Exception
	{

		
		//START OPS WEBAPP
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		String for_checking = app.step2(driver, "full");
		app.click_agreement(driver);
		app.step_payment(driver, "visa");
		app.view_or(driver);
		
		//FOR CHECKING
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		app.verifying_payment(driver, for_checking);
	}
	public static void mastercard_payment() throws Exception
	{

		
		//START OPS WEBAPP
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		String for_checking = app.step2(driver, "full");
		app.step_payment(driver, "mastercard");
		app.view_or(driver);
		
		//FOR CHECKING
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		app.verifying_payment(driver, for_checking);
	}
	public static void withguarantor_payment() throws Exception
	{
		
		//START OPS WEBAPP
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		String for_checking = app.step2(driver, "with_guarantor");
		app.click_agreement(driver);
		app.step_payment(driver, "mastercard");
		app.view_or(driver);
		
		//FOR CHECKING
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		app.verifying_payment(driver, for_checking);
	}
	public static void noguarantor_payment() throws Exception{

		
		//START OPS WEBAPP
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		String for_checking = app.step2(driver, "no_guarantor");
		app.click_agreement(driver);
		app.step_payment(driver, "mastercard");
		app.view_or(driver);
		
		//FOR CHECKING
		app.go_to_ops_web_app(driver);
		app.select_location(driver, "GC");
		app.search_patient(driver, pin, lName);
		app.verifying_payment(driver, for_checking);
	}
	
}
